<?php
define('WP_USE_THEMES', true);
$blog='NULL';
$blogdata='NULL';
$optiondomain = 'system';
$_REQUEST['b']='system';

require('private.php');
require(CONFIGPATH . 'wp-config.php');

$site_title = get_settings('site_title');

$posts = get_recent_posts(10);
	
echo '<?xml version="1.0" encoding="utf-8"?>';
$cdata_open  = '<![CDATA[';
$cdata_close = ']]>';

?>
<feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="en"
  xml:base="<?php echo LURL ?>/atom.php"
>
	<title type="text"><?php echo $site_title ?></title>

	<updated><?php echo gmdate('Y-m-d\TH:i:s\Z') ?></updated>
	<generator uri="http://lyceum.ibiblio.org/" version="<?php echo $wp_version ?>">Lyceum</generator>

	<link rel="alternate" type="text/html" href="<?php echo LURL ?>" />
	<id><?php echo LURL ?>/feed/atom.php/</id>
	<link rel="self" type="application/atom+xml" href="<?php echo LURL ?>/atom.php" />

<?php foreach ($posts as $p): ?>
	<entry>
		<author>
			<name><?php echo $p->author_nickname ?></name>
			<uri><?php echo $p->siteurl ?></uri>
		</author>
		<title type="html"><?php echo $cdata_open . $p->post_title . $cdata_close ?></title>
		<link rel="alternate" type="text/html" href="<?php echo $p->guid; ?>" />
		<id><?php echo $p->guid; ?></id>
		<published><?php echo rfc3339($p->post_date_gmt) ?></published>
		<updated><?php echo rfc3339($p->post_modified_gmt) ?></updated>
<?php if ($p->post_excerpt) : ?>
		<summary type="html"><?php echo $cdata_open . $p->post_excerpt . $cdata_close ?></summary>
<?php endif; ?>
		<content type="html" xml:base="<?php echo $p->guid; ?>"><?php echo $cdata_open . $p->post_content . $cdata_close ?></content>
	</entry>
<?php endforeach ?>
</feed>